SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
7 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
1.3 KB · 28 lines tsx
Raw Blame History
1import { fmtInt, fmtMw } from "@/lib/format";2import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template";3import { getMetro } from "./data";45export const alt = "Data center market — DataCenterIndex";6export const size = OG_SIZE;7export const contentType = OG_CONTENT_TYPE;8export const revalidate = 3600;910export default async function Image({ params }: { params: Promise<{ slug: string }> }) {11  const { slug } = await params;12  const r = await getMetro(slug);13  if (!r.ok) return renderOg({ eyebrow: "Market", title: "Data center market", subtitle: "DataCenterIndex — facilities, capacity and pipeline by metro market." });14  const m = r.data;15  const pipe = m.constructionMw === null && m.plannedMw === null ? null : (m.constructionMw ?? 0) + (m.plannedMw ?? 0);16  return renderOg({17    eyebrow: "Market",18    title: `Data centers in ${m.name}`,19    subtitle: [m.countryName ?? m.countryIso2, m.regionName && m.regionName !== m.name ? m.regionName : null].filter(Boolean).join(" · "),20    stats: [21      { label: "Facilities", value: fmtInt(m.facilityCount) },22      { label: "Known MW", value: m.knownMw === null ? "—" : fmtMw(m.knownMw) },23      { label: "Pipeline", value: pipe === null ? "—" : `≈ ${fmtMw(pipe)}` },24      { label: "Operators", value: fmtInt(m.operatorCount) },25    ],26  });27}28